/**
 * Project Name:sc-parent-service
 * File Name:HasHouseCountProbabilityImpl.java
 * Package Name:com.sc.probability.impl
 * Date:2018年6月28日下午11:11:04
 * Copyright (c) 2018, bluemobi All Rights Reserved.
 */

package com.sc.probability.impl;

import com.sc.pojo.Customer;
import com.sc.probability.Probability;

/**
 * Description: 有房的概率值  <br/>
 * Date:     2018年6月28日 下午11:11:04 <br/>
 * @author   tianyongxu
 * @version
 * @see com.sc.probability.impl.HasHouseCountProbabilityImpl
 */
public class HasHouseCountProbabilityImpl implements Probability{

    @Override
    public float getProbability(Customer customer) {
        float hasHouseCountProbability = 0.0f;
        if (customer.getChashousecount() != null) {
            if (customer.getChashousecount() == 0) {
                hasHouseCountProbability = 0.2f;
            }
            
            if (customer.getChashousecount() == 1) {
                hasHouseCountProbability = 0.1f;
            }
            
            if (customer.getChashousecount() <4) {
                hasHouseCountProbability = 0.1f;
            }
            
            if (customer.getChashousecount() < 10) {
                hasHouseCountProbability = 0.3f;
            }
        }
        
        return hasHouseCountProbability;
    }

}

